package com.ms.client.bizbase.search.service;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.ms.client.bizbase.search.pojo.SearchModel;
import com.ms.msclient.MsClient;
import com.ms.msclient.MsClientResponse;

@MsClient(value="${service.id.biz-base}", defalut="biz-base")
public interface SearchService {

	/**
	 * 创建索引
	 * @param searchModel
	 * @param system
	 * @return
	 */
	@RequestMapping(value = "/search/createIndex")
	public MsClientResponse<SearchModel> createIndex(SearchModel searchModel, @RequestParam("system")String system);

	/**
	 * 跟新索引
	 * @param searchModel
	 * @param system
	 * @return
	 */
	@RequestMapping(value = "/search/updateIndex")
	public MsClientResponse<SearchModel> updateIndex(SearchModel searchModel, @RequestParam("system")String system);

	/**
	 * 删除索引
	 * @param searchModel
	 * @param system
	 * @return
	 */
	@RequestMapping(value = "/search/deleteIndex")
	public MsClientResponse<SearchModel> deleteIndex(SearchModel searchModel, @RequestParam("system")String system);

	/**
	 * 搜索
	 * @param searchString
	 * @param searchField
	 * @param system
	 * @return
	 */
	@RequestMapping(value = "/search/search")
	public MsClientResponse<SearchModel> search(@RequestParam("searchString")String searchString, @RequestParam("searchField")String searchField, @RequestParam("system")String system);

}
